import { _decorator, Component, Node, Sprite } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('SingleFood')
export class SingleFood extends Component {

    //食物
    @property(Sprite)
    private Food: Sprite = null;

    /**
     * 更新食物样式
     */
    public UpdateFood(_index: number) {
        this.Food.node.active = _index != -1;
        this.Food.spriteFrame = app.resManager.SpriteFrames["game_food" + _index];
    }
}


